package com.example.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@RestController
@RequestMapping("/hello")
public class HelloController {

    // 获取当前类的logger
    private static final Logger logger = LoggerFactory.getLogger(HelloController.class);

    @GetMapping("/index")
    public String index () {
        //System.out.println("receive your request!");
        logger.info("receive hello/index request.");
        return "Hello, welcome!";
    }
}
